package com.example.demo.api;

import com.example.demo.bean.Response;
import com.example.demo.service.sys.SysUserService;
import com.example.demo.utils.ConstantUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
//scp -r ~/sadrwerqwer/fdf.war root@106.14.29.81:/alidata
/**
 * @author zzz
 * @Title: UserController
 * @ProjectName test
 * @Description: TODO()
 * @date 2018/7/12
 */

@CrossOrigin
@RestController
@Api(value="用户controller",tags={"用户接口"})
public class UserController {

    @Autowired
    SysUserService sysUserService;

    @ApiOperation(value="验证用户" )
    @ApiImplicitParams({
            @ApiImplicitParam(name = "account", value = "用户账户", required = true, dataType = "String",paramType = "form"),
            @ApiImplicitParam(name = "passWord", value = "用户密码", required = true, dataType = "String",paramType = "form")
    })
    @PostMapping(value="/login")
    public Response login( String account , String passWord){
        return new Response(ConstantUtils.SUCCEED,ConstantUtils.STRING_SUCCEED_LOGIN,sysUserService.login(account,passWord));
    }
    @GetMapping(value="/a")
    public Map<String, String> lo(){
        Map<String,String> map = new HashMap<>();
        map.put("callbackAction","123");

        return map;
    }



}
